< Prev(J) / Next(K) > / View :

Filename: /text/sbasic/shared/03030104.xhp

(section: month) (bookmark: bm_id3153127)
Month function

Month 関数

Month Function [Runtime]
Month 関数 [実行時](hd_id3153127.1)

Returns the month of a year from a serial date that is generated by the DateSerial or the DateValue function.
DateSerial ないし DateValue 関数による日付データのシリアル変換値を基に、該当する月を返します。(par_id3148550.2)

(/section: month)

Syntax:
構文:(hd_id3145068.3)

Month (Number)
Month (Number)(par_id3150398.4)

Return value:
戻り値:(hd_id3154366.5)

Integer
整数(par_id3154125.6)

Parameters:
パラメータ:(hd_id3150768.7)

Number: Numeric expression that contains the serial date number that is used to determine the month of the year.
Number: 月情報を得る日付データのシリアル変換値を示す数値表式。(par_id3156423.8)

This function is the opposite of the DateSerial function. It returns the month in the year that corresponds to the serial date that is generated by DateSerial or DateValue. For example, the expression
この関数は、DateSerial 関数と逆方向の機能を担っています。この場合の戻り値としては、日付データを DateSerialDateValue でシリアル変換した数値を基に、該当する月が返されます。こうした点は、下記のコードを実行してみると分かりやすいでしょう。(par_id3153770.9)

Print Month(DateSerial(1994, 12, 20))
Print Month(DateSerial(1994, 12, 20))(par_id3147426.10)

returns the value 12.
この場合の戻り値は 12 となります。(par_id3145366.11)

(embed text/sbasic/shared/00000003.xhp#errorcode : linkinfo)

Error Codes

エラーコード(hd_id3152869.37)

(/embed text/sbasic/shared/00000003.xhp#errorcode)

(embed text/sbasic/shared/00000003.xhp#err5 : linkinfo)

5 Invalid procedure call
5 無効なプロシージャー呼び出しです (par_id3150891.41)

(/embed text/sbasic/shared/00000003.xhp#err5)

Example:
例:(hd_id3146923.12)

Sub ExampleMonth
Sub ExampleMonth(par_id3156442.13)

MsgBox "" & Month(Now) ,64,"The current month"
MsgBox "" & Month(Now) ,64,"The current month"(par_id3149664.14)

End sub
End sub(par_id3150012.15)


< Prev / Next >